<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:include page="loginstatus.jsp" />
<%@ page import="model.*" %>
<%@ taglib prefix="s" uri="/struts-tags" %>   
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'importTeacher.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/common.css">
	

  </head>
<script src="js/prototype.js" type="text/javascript">  
</script>  
<script language="JavaScript">  
    function gotClick()   
    {   
        //请求的地址   
        var url = 'studentpasswordedit.action';   
        //将form1表单域的值转换为请求参数   
        var params ="stupasswordold="+document.getElementById("stupasswordold").value+"&stupasswordnew="+document.getElementById("stupasswordnew").value+"&stupasswordchecknew="+document.getElementById("stupasswordchecknew").value+"&checkcode="+document.getElementById("checkcode").value;
        //创建Ajax.Request对象，对应于发送请求   
        var myAjax = new Ajax.Request(   
        url,   
        {   
            //请求方式：POST   
            method:'post',   
            //请求参数   
            parameters:params,   
            //指定回调函数   
            onComplete: processResponse,   
            //是否异步发送请求   
            asynchronous:true   
        });   
    }   
    function processResponse(request)   
    {   
        var data = eval('('+request.responseText+')'); 
       //alert(data.message);
        if(data.message=="")
        {
        	window.open("index.jsp","_top");
        }
        else
        {
        	document.getElementById("message").innerHTML=data.message;
        }
    }      
</script> 
  <body>
  <div id="main">
  <fieldset>
  	<legend>
  		修改密码
  	</legend>
  	<table>
		  		<tr>
	  				<td class="searchTd" colspan="2"><font color="#ff0000"><span id="message"></span></font></td>
	  			</tr>
	   			<tr>
					<td class="tdstyle1">用户名</td>
					<td class="tdstyle1" colspan="2"><%out.print(session.getAttribute("stunumber"));%></td>
				</tr>
				<tr>
					<td class="tdstyle1">旧密码</td>	
					<td colspan="2">
						<input type="password" name="stupasswordold" id="stupasswordold" value=""/>
					</td>
				</tr>
				<tr>
					<td class="tdstyle1">新密码</td>
					<td colspan="2">
						<input type="password" name="stupasswordnew" id="stupasswordnew" value=""/>
					</td>
				</tr>
				<tr>
					<td class="tdstyle1">确认新密码</td>
					<td colspan="2"><input type="password" name="stupasswordchecknew" id="stupasswordchecknew" value=""/></td>
				</tr>
				<tr>
	  				<td>验证码</td><td><input type="text" name="checkcode" id="checkcode" value="" size="6"/></td><td><img src="util/image.jsp"/></td>
	  			</tr>
				<tr>
					<td class="searchTd"><input type="button" value="确定" class="button" onclick="gotClick()"/></td>
				</tr>
	</table>
  </fieldset>
  </div>
 
  </body>
</html>